var Vuex = {
  Store: function ({ state,mutations,actions }) {
    this.state = state;//保存state
    new Vue({data:state});//会把state变成响应式的对象
    this.commit = function(mutationType){
        //通过变更类型找到变更状态的函数
        let mutationFn = mutations[mutationType];
        //把状态传给变更状态的函数进行状态变更
        mutationFn(state);
    }
    this.dispatch = function(actionType){
        //通过动作类型找到动作的函数
        let actionFn = actions[actionType];
        //把状态传给动作函数并行变更的操作
        actionFn(this);
    }
  },
};
